import * as Service from '../services/getCard';
export default {
  namespace: 'getCard',
  state: {
    data: null
  },
  reducers: {
    connect(state, action) {
      return { ...state, ...action.payload };
    },
  },
  effects: {
    // *getInfo(action, { call, put }) {
    //   const data = yield call(Service.query);
    //   yield put({ type: 'connect', payload: data });
    // },
    *getInfo(action, { put, call }) {
      console.log('getinfo')
      const data = yield call(Service.query);
      yield put({
        type: 'connect',
        payload: data
      })
    },
    *clear({ payload: _State }, { call, put }){
      yield put({
        type: 'connect',
        payload: _State
      })
    }
  },
  subscriptions: {},
};
